package protocol;
import java.util.HashMap;
import java.util.Vector;



public class IRCserverDB {
	private HashMap <String,User> nicknames;
	private HashMap <String, Vector<User>> channels;
	
	public HashMap<String, User> getNicknames() {
		return nicknames;
	}

	public HashMap<String, Vector<User>> getChannels() {
		return channels;
	}

	

	public IRCserverDB()
	{
		nicknames=new HashMap<String,User>();
		channels=new HashMap<String, Vector<User>>();
		
	}

	/** ########################################################################## */
	public void writeToChannel(String msg, String channel) {
		Vector<User> channelUsers=channels.get(channel);
		for(int i=0;i<channelUsers.size();i++)
		{
			channelUsers.elementAt(i).toOutbox(msg);
		}
	}

	
}
